package com.wangyadong.hobby.front.model;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
@Configuration
public class MyFirstPostBeanProcess implements BeanPostProcessor, Ordered {

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("MyFirstPostBeanProcess " + bean.getClass().getSimpleName() + " postProcessAfterInitialization beanName is " + beanName);
        return bean;
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("MyFirstPostBeanProcess " +bean.getClass().getSimpleName() + " postProcessBeforeInitialization beanName is " + beanName);
        return bean;
    }

    @Override
    public int getOrder() {
        return -10;
    }
}
